{% extends "base.html" %}
{% block title %}Webmapper Dashboard{% endblock %}

{% block content %}
<div class="contentbox">
<h2>Webmapper Dashboard</h2>
</div>
<div class="contentbox">
    <h2>Tags</h2>
    <ul>
    {% if tag_list %}
        <li>Current Tags (<a href="{% url tag-list %}">detail list</a>):<br />
        <div style="background-color: lightblue; width: 600px;">
        {% for tag in tag_list %}
            <a href="{% url view-tag tag.pk %}">{{ tag.unique_name }}</a>
        {% endfor %}
        </div>
        </li>
    {% endif %}

    <li>
    Create A New Tag:
    <form method=post action="{% url tag-create %}">
    <table style="background-color: lightblue;">
    {{ cmtf.as_table }}
    <tr><td><input type=submit value='Create'></td></tr>
    </table>
    </form>
    </li>
    </ul>
</div>

    {% if tag_list %}
<div class="contentbox">
        <h2>Phase 1 Map Objects</h2>
        <h3>Keys</h3>
        <ul>
            <li><a href="{% url mapkey-create %}">Create New Key</a></li>
{% if key_list %}
            <li>Current Keys:<br />
                <table style="background-color: lightblue; font-size:small; font-family:arial, sans-serif; color:black; text-shadow:0 1px 1px white, 0 -1px 1px white, -1px 0 1px white, 1px 0 1px white;">
                    <tr>
                        <td style="text-decoration:underline; text-align:center; background-color: white;">Title</td>
                        <td style="text-decoration:underline; text-align:center; width:42px;">Icon</td>
                        <td style="text-decoration:underline; text-align:center; width:160px;">Description</td>
                        <td style="text-decoration:underline; text-align:center; background-color: white;"></td>
                    </tr>
{% for key in key_list %}
                    <tr>
                        <td style="text-align:center; background-color: white;">{{ key.title }}</td>
                        <td style="text-align:center;"><img style="max-width: 42px; max-height: 42px;" src="{{ key.graphic.url }}" alt="{{ key.title }}"/></td>
                        <td style="text-align:center;">{{ key.description }}</td>
                        <td style="text-align:center; background-color: white;"><a href="{% url mapkey-edit key.pk %}">(edit)</a></td>
                    </tr>
{% endfor %}
                </table>
            </li>
{% endif %}
        </ul>

        <h3>Static KML Layers</h3>
        <ul>
            <li><a href="{% url layer-kml-upload %}">Upload New KML Layer</a></li>
{% if layer_list %}
            <li>Current Layers:<br />
                <div style="background-color: lightblue; width: 600px;">
                {% for layer in layer_list %}
                    <a href="{% url layer-edit layer.pk %}">{{ layer.title }}</a>
                {% endfor %}
                </div>
            </li>
{% endif %}
        </ul>
        
        <h3>Maps</h3>
        <ul>
            <li><a href="{% url map-create %}">Create New Map</a></li>
{% if map_list %}
            <li>Current Maps:<br />
                <div style="background-color: lightblue; width: 600px;">
                {% for map in map_list %}
                    <b>{{ map.title }}</b>
                    (<a href="{% url map-edit map.pk %}">edit</a>)
                    : <a href="{% url map-snap map.unique_name %}">Map Snap</a>
                    | <a href="{% url map-info map.unique_name %}">Overview</a><br/>
                {% endfor %}
                </div>
            </li>
{% endif %}
        </ul>
</div>

<div class="contentbox">
        <h2>Phase 2 Map Objects</h2>
        <h3>Photos</h3>
        <h3>Routes</h3>
        <h3>Areas</h3>
        <h3>Points Of Interest</h3>
</div>
        
<div class="contentbox"
     <h2>Custom Views</h2>
        <h3>Maps</h3>
        <h3>SlideShows</h3>
</div>
    {% else %}
        <div class="contentbox" style="color: RED;">
            You need to create some tags before you can do anything.  Tags are
        needed to organize and sort other Map Objects.
        </div>
    {% endif %}

{% endblock %}
